﻿using System;
using UnityEngine;

namespace UnityStandardAssets.CinematicEffects
{
	// Token: 0x02000599 RID: 1433
	public static class ImageEffectHelper
	{
		// Token: 0x06001CDD RID: 7389 RVA: 0x00061B58 File Offset: 0x0005FD58
		public static bool IsSupported(Shader s, bool needDepth, bool needHdr, MonoBehaviour effect)
		{
			if (s == null || !s.isSupported)
			{
				Debug.LogWarning(string.Format("Missing shader for image effect {0}", new object[]
				{
					effect
				}));
				return false;
			}
			return SystemInfo.supportsImageEffects && SystemInfo.supportsRenderTextures && (!needDepth || SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.Depth)) && (!needHdr || SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf));
		}

		// Token: 0x06001CDE RID: 7390 RVA: 0x00061BD0 File Offset: 0x0005FDD0
		public static Material CheckShaderAndCreateMaterial(Shader s)
		{
			if (s == null || !s.isSupported)
			{
				return null;
			}
			return new Material(s)
			{
				hideFlags = HideFlags.DontSave
			};
		}

		// Token: 0x17000209 RID: 521
		// (get) Token: 0x06001CDF RID: 7391 RVA: 0x00012224 File Offset: 0x00010424
		public static bool supportsDX11
		{
			get
			{
				return SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders;
			}
		}
	}
}
